package br.uvv.sao.rn;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import br.uvv.sao.dao.DisciplinaDAO;
import br.uvv.sao.dao.OfertaDisciplinaDAO;
import br.uvv.sao.dao.ProfessorDAO;
import br.uvv.sao.dao.ProvaDAO;
import br.uvv.sao.domain.Disciplina;
import br.uvv.sao.domain.OfertaDisciplina;
import br.uvv.sao.domain.Professor;
import br.uvv.sao.domain.Prova;
import br.uvv.sao.util.DAOException;
import br.uvv.sao.util.RNException;

public class RelatorioRN implements Serializable {
	
	private static final long serialVersionUID = 8026046432774691176L;
	
	private ProfessorDAO professorDAO = new ProfessorDAO();
	private DisciplinaDAO disciplinaDAO = new DisciplinaDAO();
	
	public List<OfertaDisciplina> listarOferta(Long idDisciplina, Long idProfessor, String semestre, Date ano) throws RNException{
		OfertaDisciplinaDAO dao = new OfertaDisciplinaDAO();
		try {
			return dao.listar(idDisciplina, idProfessor, semestre, ano);
		} catch (DAOException e) {
			throw new RNException(e);
		}
	}
	
	public ArrayList<Disciplina> listarDisciplina() throws RNException {
		try {
			return (ArrayList<Disciplina>) this.disciplinaDAO.listar();
		} catch (DAOException e) {
			throw new RNException(e);
		}
	}
	
	public ArrayList<Professor> listarProfessor() {
		return (ArrayList<Professor>) this.professorDAO.listar();
	}

	public Prova selecionarProva(Integer id) {
		return null;
	}

	public List<Prova> listarProvasOferta(Long id) throws RNException {
		ProvaDAO dao = new ProvaDAO();
		try {
			return dao.listarProvasEmOferta(id);
		} catch (DAOException e) {
			throw new RNException(e);
		}
	}
}
